<?php
namespace Mouta\UserBundle\Form\Type;

use Symfony\Component\Form\FormBuilderInterface;
use FOS\UserBundle\Form\Type\RegistrationFormType as BaseType;
use Mouta\AmistateBundle\Entity\Usuario;

class RegistrationFormType extends BaseType
{
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
			->add('nombre','text')
            ->add('email', 'email')
			->add('sexo','choice', array(
                'choices'   => array('0' => 'Hombre', '1' => 'Mujer'),
                'required'  => false,
                'label'  => "Soy",
                'empty_value' => false
            ))
			->add('cumple','birthday', array(
                'format' => 'ddMMyyyy',
                'label'  => 'Cumpleaños',
                'years' => range(date('Y'), date('Y')-70)
            ))
			->add('busco','choice', array(
                'choices'   => array('0' => 'Hombre', '1' => 'Mujer'),
                'required'  => false,
                'empty_value' => false
            ))
            ->add('para','choice', array(
                'choices'   => Usuario::getOpcionesPara(),
                'required'  => false,
                'empty_value' => false
            ))
            ->add('plainPassword', 'repeated', array(
                'type' => 'password',
                'options' => array('translation_domain' => 'FOSUserBundle'),
                'first_options' => array('label' => 'Clave'),
                'second_options' => array('label' => 'Conf. clave'),
                'invalid_message' => 'fos_user.password.mismatch',
            ))
        ;
		
		/*$builder->add('username')
            ->add('usernameCanonical')
            ->add('email')
            ->add('emailCanonical')
            ->add('enabled')
            ->add('password')
            ->add('lastLogin')
            ->add('locked')
            ->add('expired')
            ->add('confirmationToken')
            ->add('roles')
            ->add('credentialsExpired')
            ->add('nombre')
            ->add('apellido')
            ->add('slug')
            ->add('sexo')
            ->add('busco')
            ->add('cumple')
				
            ->add('pais')
            ->add('provincia')
            ->add('localidad')
            ->add('seo_pais')
            ->add('seo_provincia')
            ->add('seo_localidad')
            ->add('lat')
            ->add('lng')
				
            ->add('para')
            ->add('ip')
            
            
            ;*/
    }

    public function getName()
    {
        return 'amistate_user_registration';
    }
}